//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.app.system.utils.dataType;

import com.app.system.permission.model.DataDict;
import com.app.system.utils.CollectionUtils;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.List;

public class StringUtils {

    public static String getNotNull(String s) {
        return s == null ? "" : s;
    }

    public static String getNotNullText(String s) {
        return s == null || s.equals("") ? "/" : s;
    }

    public static boolean isNotEmpty(String string) {
        return !isEmpty(string);
    }

    public static boolean isEmpty(String string) {
        return string == null || "".equals(string);
    }

    public static String dataDictShow(DataDict dataDict) {
        StringBuffer text = new StringBuffer("");
        if (dataDict != null) {
            text.append("<span style='color:" + dataDict.getColor() + ";'>");
            text.append(dataDict.getName());
            text.append("</span>");
        }
        return text.toString();
    }

    public static String getBuildNumForShow(String string) {
        return string.substring(string.indexOf("-") + 1);
    }

    public static String getStringByList(List<String> stringList) {
        String result = "";
        if (CollectionUtils.isNotEmpty(stringList)) {
            for (String s : stringList) {
                result = result + s + "、";
            }
        }
        return result;
    }
}
